﻿<Window x:Class="testProject.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" WindowStyle="None" WindowState="Maximized"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ResizeMode="CanResizeWithGrip" AllowsTransparency="True"
        Title="Window1" MinHeight="300" MinWidth="300" xmlns:my="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls">
	<Window.Resources>
		<Style x:Key="ItemsControlStyle1" TargetType="{x:Type ItemsControl}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ItemsControl}">
						<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
              
        </ItemsPanelTemplate>
	</Window.Resources>
    <Grid Background="Red" >
        <Button Content="Ctr+D" Height="23"
                HorizontalAlignment="Left" 
                Margin="77,36,0,0" Name="btnCtrD"
                VerticalAlignment="Top" Width="75" Click="btnCtrD_Click" />
        <Button Content="Ctr+F" Height="23" HorizontalAlignment="Left" Margin="77,98,0,0" Name="btnCtrlF" VerticalAlignment="Top" Width="75" Click="btnCtrlF_Click" />
        <Image x:Name="imgTest" Source="http://s1.t.itc.cn/mblog/pic/201104/2/16/f_13017328123934.jpg"  />
        <StackPanel>
            <ListBox BorderThickness="0" Margin="20,0,0,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                <ListBox.Resources>
                    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
                    <Style TargetType="my:HotKeyGenerateTextBox">
                        <Setter Property="Height" Value="20"/>
                        <Setter Property="Width" Value="110"/>
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                    </Style>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Margin" Value="0,2,0,0"/>
                    </Style>
                    <Style TargetType="TextBlock">
                        <Setter Property="MinWidth" Value="60"/>
                    </Style>
                </ListBox.Resources>
                <DockPanel Height="20">
                    <TextBlock Text="截屏:"/>
                    <my:HotKeyGenerateTextBox NoHotKeyTip="无"  Text="Alt+Ctrl+Shift+X" GotFocus="HotKeyGeneratorTextBox_GotFocus" Name="txtCaptureScreen"  />
                    <TextBlock Text="按键设置" Visibility="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor},Converter={StaticResource BooleanToVisibilityConverter}}"/>
                </DockPanel>
                <DockPanel>
                    <TextBlock Text="获取私信:"/>
                    <my:HotKeyGenerateTextBox NoHotKeyTip="无" GotFocus="HotKeyGeneratorTextBox_GotFocus"  Name="hotKeyGenerateTextBox2" />
                    <TextBlock Text="按键设置" Visibility="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor},Converter={StaticResource BooleanToVisibilityConverter}}"/>
                </DockPanel>
                <DockPanel>
                    <TextBlock Text="获取评论:"/>
                    <my:HotKeyGenerateTextBox NoHotKeyTip="无" GotFocus="HotKeyGeneratorTextBox_GotFocus"  Name="hotKeyGenerateTextBox3" />
                    <TextBlock Text="按键设置" Visibility="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor},Converter={StaticResource BooleanToVisibilityConverter}}"/>
                </DockPanel>
            </ListBox>

            <Button Content="GetHotKeys" Click="btnGetHotKeys_Click"/>
        </StackPanel>
    </Grid>
</Window>
